<?php
	include_once("bin/connexion.php");

	if(isset($_POST["envoyer"])){
		
		$nom = $_POST["nom"];
		$prenom = $_POST["prenom"];
		$password = $_POST["password"];
		$mail = $_POST["mail"];
		$query = "INSERT INTO user (id, nom, prenom, mail, password, bailleur) VALUES ('', '$nom', '$prenom', '$mail', '$password', 0)";
		
		$resultat= mysqli_query ($bdd, $query);
		
		if ($resultat === false)
		{
			$erreur = "impossible d'enregistrer";
		}
		else
		{
			header('location: index.php');
		}
	}
	include_once("freebed-register.html");
?>
